package com.ysd.Servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.ChanPinXiangQingDaoimpl;
import com.ysd.dao.impl.LunBoTuDaoimpl;
import com.ysd.dao.impl.XiYangYangChaoShiDaoimpl;

import com.ysd.entity.ChanPinXiangQing;
import com.ysd.entity.LunBoTu;
import com.ysd.entity.XiYangYangChaoShi;

/**
 * Servlet implementation class HeadServlet
 */
public class HeadServlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		XiYangYangChaoShiDaoimpl xyycsd=new  XiYangYangChaoShiDaoimpl();//获得喜洋洋超市的实现类
		XiYangYangChaoShi xyycs=xyycsd.getXiYangYangCahoShi();//通过喜洋洋超市的实现类来获取数据
		request.setAttribute("xyycs", xyycs);//存数据到下个页面
		
		
		
		LunBoTuDaoimpl lbtDao=new LunBoTuDaoimpl();//获得轮播图的实现类
		ArrayList<LunBoTu>lbt=lbtDao.getLunBoTu();//获得实现类的方法
		request.setAttribute("lbt", lbt);
		
		
		
		ChanPinXiangQingDaoimpl cpxqDao=new ChanPinXiangQingDaoimpl();//获得产品详情的实现类
		ArrayList<ChanPinXiangQing> cpxqList=cpxqDao.getJingPingAnLi();//获得产品详情的实现类的方法
		request.setAttribute("cpxqList", cpxqList);
		
		request.getRequestDispatcher("head.jsp").include(request, response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
